
/**
 * This is a generated class and is not intended for modification.  
 */
package com.model.valueObjects
{
import com.adobe.fiber.styles.IStyle;
import com.adobe.fiber.styles.Style;
import com.adobe.fiber.styles.StyleValidator;
import com.adobe.fiber.valueobjects.AbstractEntityMetadata;
import com.adobe.fiber.valueobjects.AvailablePropertyIterator;
import com.adobe.fiber.valueobjects.IPropertyIterator;
import mx.events.ValidationResultEvent;
import com.adobe.fiber.core.model_internal;
import com.adobe.fiber.valueobjects.IModelType;
import mx.events.PropertyChangeEvent;

use namespace model_internal;

[ExcludeClass]
internal class _VoProductStockLinksEntityMetadata extends com.adobe.fiber.valueobjects.AbstractEntityMetadata
{
    private static var emptyArray:Array = new Array();

    model_internal static var allProperties:Array = new Array("po_expected_datetime", "po_id", "po_issue_date", "po_serialnumber", "supplier_name", "supplier_serialnumber_fk", "pro_serialnumber_fk", "on_hand");
    model_internal static var allAssociationProperties:Array = new Array();
    model_internal static var allRequiredProperties:Array = new Array("po_expected_datetime", "po_id", "po_issue_date", "po_serialnumber", "supplier_name", "supplier_serialnumber_fk", "pro_serialnumber_fk", "on_hand");
    model_internal static var allAlwaysAvailableProperties:Array = new Array("po_expected_datetime", "po_id", "po_issue_date", "po_serialnumber", "supplier_name", "supplier_serialnumber_fk", "pro_serialnumber_fk", "on_hand");
    model_internal static var guardedProperties:Array = new Array();
    model_internal static var dataProperties:Array = new Array("po_expected_datetime", "po_id", "po_issue_date", "po_serialnumber", "supplier_name", "supplier_serialnumber_fk", "pro_serialnumber_fk", "on_hand");
    model_internal static var derivedProperties:Array = new Array();
    model_internal static var collectionProperties:Array = new Array();
    model_internal static var collectionBaseMap:Object;
    model_internal static var entityName:String = "VoProductStockLinks";
    model_internal static var dependentsOnMap:Object;
    model_internal static var dependedOnServices:Array = new Array();

    
    model_internal var _po_expected_datetimeIsValid:Boolean;
    model_internal var _po_expected_datetimeValidator:com.adobe.fiber.styles.StyleValidator;
    model_internal var _po_expected_datetimeIsValidCacheInitialized:Boolean = false;
    model_internal var _po_expected_datetimeValidationFailureMessages:Array;
    
    model_internal var _po_idIsValid:Boolean;
    model_internal var _po_idValidator:com.adobe.fiber.styles.StyleValidator;
    model_internal var _po_idIsValidCacheInitialized:Boolean = false;
    model_internal var _po_idValidationFailureMessages:Array;
    
    model_internal var _po_issue_dateIsValid:Boolean;
    model_internal var _po_issue_dateValidator:com.adobe.fiber.styles.StyleValidator;
    model_internal var _po_issue_dateIsValidCacheInitialized:Boolean = false;
    model_internal var _po_issue_dateValidationFailureMessages:Array;
    
    model_internal var _supplier_nameIsValid:Boolean;
    model_internal var _supplier_nameValidator:com.adobe.fiber.styles.StyleValidator;
    model_internal var _supplier_nameIsValidCacheInitialized:Boolean = false;
    model_internal var _supplier_nameValidationFailureMessages:Array;

    model_internal var _instance:_Super_VoProductStockLinks;
    model_internal static var _nullStyle:com.adobe.fiber.styles.Style = new com.adobe.fiber.styles.Style();

    public function _VoProductStockLinksEntityMetadata(value : _Super_VoProductStockLinks)
    {
        // initialize property maps
        if (model_internal::dependentsOnMap == null)
        {
            // depenents map
            model_internal::dependentsOnMap = new Object();
            model_internal::dependentsOnMap["po_expected_datetime"] = new Array();
            model_internal::dependentsOnMap["po_id"] = new Array();
            model_internal::dependentsOnMap["po_issue_date"] = new Array();
            model_internal::dependentsOnMap["po_serialnumber"] = new Array();
            model_internal::dependentsOnMap["supplier_name"] = new Array();
            model_internal::dependentsOnMap["supplier_serialnumber_fk"] = new Array();
            model_internal::dependentsOnMap["pro_serialnumber_fk"] = new Array();
            model_internal::dependentsOnMap["on_hand"] = new Array();

            // collection base map
            model_internal::collectionBaseMap = new Object()
        }

        model_internal::_instance = value;
        model_internal::_po_expected_datetimeValidator = new StyleValidator(model_internal::_instance.model_internal::_doValidationForPo_expected_datetime);
        model_internal::_po_expected_datetimeValidator.required = true;
        model_internal::_po_expected_datetimeValidator.requiredFieldError = "po_expected_datetime is required";
        //model_internal::_po_expected_datetimeValidator.source = model_internal::_instance;
        //model_internal::_po_expected_datetimeValidator.property = "po_expected_datetime";
        model_internal::_po_idValidator = new StyleValidator(model_internal::_instance.model_internal::_doValidationForPo_id);
        model_internal::_po_idValidator.required = true;
        model_internal::_po_idValidator.requiredFieldError = "po_id is required";
        //model_internal::_po_idValidator.source = model_internal::_instance;
        //model_internal::_po_idValidator.property = "po_id";
        model_internal::_po_issue_dateValidator = new StyleValidator(model_internal::_instance.model_internal::_doValidationForPo_issue_date);
        model_internal::_po_issue_dateValidator.required = true;
        model_internal::_po_issue_dateValidator.requiredFieldError = "po_issue_date is required";
        //model_internal::_po_issue_dateValidator.source = model_internal::_instance;
        //model_internal::_po_issue_dateValidator.property = "po_issue_date";
        model_internal::_supplier_nameValidator = new StyleValidator(model_internal::_instance.model_internal::_doValidationForSupplier_name);
        model_internal::_supplier_nameValidator.required = true;
        model_internal::_supplier_nameValidator.requiredFieldError = "supplier_name is required";
        //model_internal::_supplier_nameValidator.source = model_internal::_instance;
        //model_internal::_supplier_nameValidator.property = "supplier_name";
    }

    override public function getEntityName():String
    {
        return model_internal::entityName;
    }

    override public function getProperties():Array
    {
        return model_internal::allProperties;
    }

    override public function getAssociationProperties():Array
    {
        return model_internal::allAssociationProperties;
    }

    override public function getRequiredProperties():Array
    {
         return model_internal::allRequiredProperties;   
    }

    override public function getDataProperties():Array
    {
        return model_internal::dataProperties;
    }

    override public function getGuardedProperties():Array
    {
        return model_internal::guardedProperties;
    }

    override public function getUnguardedProperties():Array
    {
        return model_internal::allAlwaysAvailableProperties;
    }

    override public function getDependants(propertyName:String):Array
    {
       if (model_internal::dataProperties.indexOf(propertyName) == -1)
            throw new Error(propertyName + " is not a data property of entity VoProductStockLinks");  
            
       return model_internal::dependentsOnMap[propertyName] as Array;  
    }

    override public function getDependedOnServices():Array
    {
        return model_internal::dependedOnServices;
    }

    override public function getCollectionProperties():Array
    {
        return model_internal::collectionProperties;
    }

    override public function getCollectionBase(propertyName:String):String
    {
        if (model_internal::collectionProperties.indexOf(propertyName) == -1)
            throw new Error(propertyName + " is not a collection property of entity VoProductStockLinks");  

        return model_internal::collectionBaseMap[propertyName];
    }

    override public function getAvailableProperties():com.adobe.fiber.valueobjects.IPropertyIterator
    {
        return new com.adobe.fiber.valueobjects.AvailablePropertyIterator(this);
    }

    override public function getValue(propertyName:String):*
    {
        if (model_internal::allProperties.indexOf(propertyName) == -1)
        {
            throw new Error(propertyName + " does not exist for entity VoProductStockLinks");
        }

        return model_internal::_instance[propertyName];
    }

    override public function setValue(propertyName:String, value:*):void
    {
        if (model_internal::dataProperties.indexOf(propertyName) == -1)
        {
            throw new Error(propertyName + " is not a data property of entity VoProductStockLinks");
        }

        model_internal::_instance[propertyName] = value;
    }

    override public function getMappedByProperty(associationProperty:String):String
    {
        switch(associationProperty)
        {
            default:
            {
                return null;
            }
        }
    }

    override public function getPropertyLength(propertyName:String):int
    {
        switch(propertyName)
        {
            default:
            {
                return 0;
            }
        }
    }

    override public function isAvailable(propertyName:String):Boolean
    {
        if (model_internal::allProperties.indexOf(propertyName) == -1)
        {
            throw new Error(propertyName + " does not exist for entity VoProductStockLinks");
        }

        if (model_internal::allAlwaysAvailableProperties.indexOf(propertyName) != -1)
        {
            return true;
        }

        switch(propertyName)
        {
            default:
            {
                return true;
            }
        }
    }

    override public function getIdentityMap():Object
    {
        var returnMap:Object = new Object();

        return returnMap;
    }

    [Bindable(event="propertyChange")]
    override public function get invalidConstraints():Array
    {
        if (model_internal::_instance.model_internal::_cacheInitialized_isValid)
        {
            return model_internal::_instance.model_internal::_invalidConstraints;
        }
        else
        {
            // recalculate isValid
            model_internal::_instance.model_internal::_isValid = model_internal::_instance.model_internal::calculateIsValid();
            return model_internal::_instance.model_internal::_invalidConstraints;        
        }
    }

    [Bindable(event="propertyChange")]
    override public function get validationFailureMessages():Array
    {
        if (model_internal::_instance.model_internal::_cacheInitialized_isValid)
        {
            return model_internal::_instance.model_internal::_validationFailureMessages;
        }
        else
        {
            // recalculate isValid
            model_internal::_instance.model_internal::_isValid = model_internal::_instance.model_internal::calculateIsValid();
            return model_internal::_instance.model_internal::_validationFailureMessages;
        }
    }

    override public function getDependantInvalidConstraints(propertyName:String):Array
    {
        var dependants:Array = getDependants(propertyName);
        if (dependants.length == 0)
        {
            return emptyArray;
        }

        var currentlyInvalid:Array = invalidConstraints;
        if (currentlyInvalid.length == 0)
        {
            return emptyArray;
        }

        var filterFunc:Function = function(element:*, index:int, arr:Array):Boolean
        {
            return dependants.indexOf(element) > -1;
        }

        return currentlyInvalid.filter(filterFunc);
    }

    /**
     * isValid
     */
    [Bindable(event="propertyChange")] 
    public function get isValid() : Boolean
    {
        if (model_internal::_instance.model_internal::_cacheInitialized_isValid)
        {
            return model_internal::_instance.model_internal::_isValid;
        }
        else
        {
            // recalculate isValid
            model_internal::_instance.model_internal::_isValid = model_internal::_instance.model_internal::calculateIsValid();
            return model_internal::_instance.model_internal::_isValid;
        }
    }

    [Bindable(event="propertyChange")]
    public function get isPo_expected_datetimeAvailable():Boolean
    {
        return true;
    }

    [Bindable(event="propertyChange")]
    public function get isPo_idAvailable():Boolean
    {
        return true;
    }

    [Bindable(event="propertyChange")]
    public function get isPo_issue_dateAvailable():Boolean
    {
        return true;
    }

    [Bindable(event="propertyChange")]
    public function get isPo_serialnumberAvailable():Boolean
    {
        return true;
    }

    [Bindable(event="propertyChange")]
    public function get isSupplier_nameAvailable():Boolean
    {
        return true;
    }

    [Bindable(event="propertyChange")]
    public function get isSupplier_serialnumber_fkAvailable():Boolean
    {
        return true;
    }

    [Bindable(event="propertyChange")]
    public function get isPro_serialnumber_fkAvailable():Boolean
    {
        return true;
    }

    [Bindable(event="propertyChange")]
    public function get isOn_handAvailable():Boolean
    {
        return true;
    }


    /**
     * derived property recalculation
     */
    public function invalidateDependentOnPo_expected_datetime():void
    {
        if (model_internal::_po_expected_datetimeIsValidCacheInitialized )
        {
            model_internal::_instance.model_internal::_doValidationCacheOfPo_expected_datetime = null;
            model_internal::calculatePo_expected_datetimeIsValid();
        }
    }
    public function invalidateDependentOnPo_id():void
    {
        if (model_internal::_po_idIsValidCacheInitialized )
        {
            model_internal::_instance.model_internal::_doValidationCacheOfPo_id = null;
            model_internal::calculatePo_idIsValid();
        }
    }
    public function invalidateDependentOnPo_issue_date():void
    {
        if (model_internal::_po_issue_dateIsValidCacheInitialized )
        {
            model_internal::_instance.model_internal::_doValidationCacheOfPo_issue_date = null;
            model_internal::calculatePo_issue_dateIsValid();
        }
    }
    public function invalidateDependentOnSupplier_name():void
    {
        if (model_internal::_supplier_nameIsValidCacheInitialized )
        {
            model_internal::_instance.model_internal::_doValidationCacheOfSupplier_name = null;
            model_internal::calculateSupplier_nameIsValid();
        }
    }

    model_internal function fireChangeEvent(propertyName:String, oldValue:Object, newValue:Object):void
    {
        this.dispatchEvent(mx.events.PropertyChangeEvent.createUpdateEvent(this, propertyName, oldValue, newValue));
    }

    [Bindable(event="propertyChange")]   
    public function get po_expected_datetimeStyle():com.adobe.fiber.styles.Style
    {
        return model_internal::_nullStyle;
    }

    public function get po_expected_datetimeValidator() : StyleValidator
    {
        return model_internal::_po_expected_datetimeValidator;
    }

    model_internal function set _po_expected_datetimeIsValid_der(value:Boolean):void 
    {
        var oldValue:Boolean = model_internal::_po_expected_datetimeIsValid;         
        if (oldValue !== value)
        {
            model_internal::_po_expected_datetimeIsValid = value;
            this.dispatchEvent(mx.events.PropertyChangeEvent.createUpdateEvent(this, "po_expected_datetimeIsValid", oldValue, value));
        }                             
    }

    [Bindable(event="propertyChange")]
    public function get po_expected_datetimeIsValid():Boolean
    {
        if (!model_internal::_po_expected_datetimeIsValidCacheInitialized)
        {
            model_internal::calculatePo_expected_datetimeIsValid();
        }

        return model_internal::_po_expected_datetimeIsValid;
    }

    model_internal function calculatePo_expected_datetimeIsValid():void
    {
        var valRes:ValidationResultEvent = model_internal::_po_expected_datetimeValidator.validate(model_internal::_instance.po_expected_datetime)
        model_internal::_po_expected_datetimeIsValid_der = (valRes.results == null);
        model_internal::_po_expected_datetimeIsValidCacheInitialized = true;
        if (valRes.results == null)
             model_internal::po_expected_datetimeValidationFailureMessages_der = emptyArray;
        else
        {
            var _valFailures:Array = new Array();
            for (var a:int = 0 ; a<valRes.results.length ; a++)
            {
                _valFailures.push(valRes.results[a].errorMessage);
            }
            model_internal::po_expected_datetimeValidationFailureMessages_der = _valFailures;
        }
    }

    [Bindable(event="propertyChange")]
    public function get po_expected_datetimeValidationFailureMessages():Array
    {
        if (model_internal::_po_expected_datetimeValidationFailureMessages == null)
            model_internal::calculatePo_expected_datetimeIsValid();

        return _po_expected_datetimeValidationFailureMessages;
    }

    model_internal function set po_expected_datetimeValidationFailureMessages_der(value:Array) : void
    {
        var oldValue:Array = model_internal::_po_expected_datetimeValidationFailureMessages;

        var needUpdate : Boolean = false;
        if (oldValue == null)
            needUpdate = true;
    
        // avoid firing the event when old and new value are different empty arrays
        if (!needUpdate && (oldValue !== value && (oldValue.length > 0 || value.length > 0)))
        {
            if (oldValue.length == value.length)
            {
                for (var a:int=0; a < oldValue.length; a++)
                {
                    if (oldValue[a] !== value[a])
                    {
                        needUpdate = true;
                        break;
                    }
                }
            }
            else
            {
                needUpdate = true;
            }
        }

        if (needUpdate)
        {
            model_internal::_po_expected_datetimeValidationFailureMessages = value;   
            this.dispatchEvent(mx.events.PropertyChangeEvent.createUpdateEvent(this, "po_expected_datetimeValidationFailureMessages", oldValue, value));
            // Only execute calculateIsValid if it has been called before, to update the validationFailureMessages for
            // the entire entity.
            if (model_internal::_instance.model_internal::_cacheInitialized_isValid)
            {
                model_internal::_instance.model_internal::isValid_der = model_internal::_instance.model_internal::calculateIsValid();
            }
        }
    }

    [Bindable(event="propertyChange")]   
    public function get po_idStyle():com.adobe.fiber.styles.Style
    {
        return model_internal::_nullStyle;
    }

    public function get po_idValidator() : StyleValidator
    {
        return model_internal::_po_idValidator;
    }

    model_internal function set _po_idIsValid_der(value:Boolean):void 
    {
        var oldValue:Boolean = model_internal::_po_idIsValid;         
        if (oldValue !== value)
        {
            model_internal::_po_idIsValid = value;
            this.dispatchEvent(mx.events.PropertyChangeEvent.createUpdateEvent(this, "po_idIsValid", oldValue, value));
        }                             
    }

    [Bindable(event="propertyChange")]
    public function get po_idIsValid():Boolean
    {
        if (!model_internal::_po_idIsValidCacheInitialized)
        {
            model_internal::calculatePo_idIsValid();
        }

        return model_internal::_po_idIsValid;
    }

    model_internal function calculatePo_idIsValid():void
    {
        var valRes:ValidationResultEvent = model_internal::_po_idValidator.validate(model_internal::_instance.po_id)
        model_internal::_po_idIsValid_der = (valRes.results == null);
        model_internal::_po_idIsValidCacheInitialized = true;
        if (valRes.results == null)
             model_internal::po_idValidationFailureMessages_der = emptyArray;
        else
        {
            var _valFailures:Array = new Array();
            for (var a:int = 0 ; a<valRes.results.length ; a++)
            {
                _valFailures.push(valRes.results[a].errorMessage);
            }
            model_internal::po_idValidationFailureMessages_der = _valFailures;
        }
    }

    [Bindable(event="propertyChange")]
    public function get po_idValidationFailureMessages():Array
    {
        if (model_internal::_po_idValidationFailureMessages == null)
            model_internal::calculatePo_idIsValid();

        return _po_idValidationFailureMessages;
    }

    model_internal function set po_idValidationFailureMessages_der(value:Array) : void
    {
        var oldValue:Array = model_internal::_po_idValidationFailureMessages;

        var needUpdate : Boolean = false;
        if (oldValue == null)
            needUpdate = true;
    
        // avoid firing the event when old and new value are different empty arrays
        if (!needUpdate && (oldValue !== value && (oldValue.length > 0 || value.length > 0)))
        {
            if (oldValue.length == value.length)
            {
                for (var a:int=0; a < oldValue.length; a++)
                {
                    if (oldValue[a] !== value[a])
                    {
                        needUpdate = true;
                        break;
                    }
                }
            }
            else
            {
                needUpdate = true;
            }
        }

        if (needUpdate)
        {
            model_internal::_po_idValidationFailureMessages = value;   
            this.dispatchEvent(mx.events.PropertyChangeEvent.createUpdateEvent(this, "po_idValidationFailureMessages", oldValue, value));
            // Only execute calculateIsValid if it has been called before, to update the validationFailureMessages for
            // the entire entity.
            if (model_internal::_instance.model_internal::_cacheInitialized_isValid)
            {
                model_internal::_instance.model_internal::isValid_der = model_internal::_instance.model_internal::calculateIsValid();
            }
        }
    }

    [Bindable(event="propertyChange")]   
    public function get po_issue_dateStyle():com.adobe.fiber.styles.Style
    {
        return model_internal::_nullStyle;
    }

    public function get po_issue_dateValidator() : StyleValidator
    {
        return model_internal::_po_issue_dateValidator;
    }

    model_internal function set _po_issue_dateIsValid_der(value:Boolean):void 
    {
        var oldValue:Boolean = model_internal::_po_issue_dateIsValid;         
        if (oldValue !== value)
        {
            model_internal::_po_issue_dateIsValid = value;
            this.dispatchEvent(mx.events.PropertyChangeEvent.createUpdateEvent(this, "po_issue_dateIsValid", oldValue, value));
        }                             
    }

    [Bindable(event="propertyChange")]
    public function get po_issue_dateIsValid():Boolean
    {
        if (!model_internal::_po_issue_dateIsValidCacheInitialized)
        {
            model_internal::calculatePo_issue_dateIsValid();
        }

        return model_internal::_po_issue_dateIsValid;
    }

    model_internal function calculatePo_issue_dateIsValid():void
    {
        var valRes:ValidationResultEvent = model_internal::_po_issue_dateValidator.validate(model_internal::_instance.po_issue_date)
        model_internal::_po_issue_dateIsValid_der = (valRes.results == null);
        model_internal::_po_issue_dateIsValidCacheInitialized = true;
        if (valRes.results == null)
             model_internal::po_issue_dateValidationFailureMessages_der = emptyArray;
        else
        {
            var _valFailures:Array = new Array();
            for (var a:int = 0 ; a<valRes.results.length ; a++)
            {
                _valFailures.push(valRes.results[a].errorMessage);
            }
            model_internal::po_issue_dateValidationFailureMessages_der = _valFailures;
        }
    }

    [Bindable(event="propertyChange")]
    public function get po_issue_dateValidationFailureMessages():Array
    {
        if (model_internal::_po_issue_dateValidationFailureMessages == null)
            model_internal::calculatePo_issue_dateIsValid();

        return _po_issue_dateValidationFailureMessages;
    }

    model_internal function set po_issue_dateValidationFailureMessages_der(value:Array) : void
    {
        var oldValue:Array = model_internal::_po_issue_dateValidationFailureMessages;

        var needUpdate : Boolean = false;
        if (oldValue == null)
            needUpdate = true;
    
        // avoid firing the event when old and new value are different empty arrays
        if (!needUpdate && (oldValue !== value && (oldValue.length > 0 || value.length > 0)))
        {
            if (oldValue.length == value.length)
            {
                for (var a:int=0; a < oldValue.length; a++)
                {
                    if (oldValue[a] !== value[a])
                    {
                        needUpdate = true;
                        break;
                    }
                }
            }
            else
            {
                needUpdate = true;
            }
        }

        if (needUpdate)
        {
            model_internal::_po_issue_dateValidationFailureMessages = value;   
            this.dispatchEvent(mx.events.PropertyChangeEvent.createUpdateEvent(this, "po_issue_dateValidationFailureMessages", oldValue, value));
            // Only execute calculateIsValid if it has been called before, to update the validationFailureMessages for
            // the entire entity.
            if (model_internal::_instance.model_internal::_cacheInitialized_isValid)
            {
                model_internal::_instance.model_internal::isValid_der = model_internal::_instance.model_internal::calculateIsValid();
            }
        }
    }

    [Bindable(event="propertyChange")]   
    public function get po_serialnumberStyle():com.adobe.fiber.styles.Style
    {
        return model_internal::_nullStyle;
    }

    [Bindable(event="propertyChange")]   
    public function get supplier_nameStyle():com.adobe.fiber.styles.Style
    {
        return model_internal::_nullStyle;
    }

    public function get supplier_nameValidator() : StyleValidator
    {
        return model_internal::_supplier_nameValidator;
    }

    model_internal function set _supplier_nameIsValid_der(value:Boolean):void 
    {
        var oldValue:Boolean = model_internal::_supplier_nameIsValid;         
        if (oldValue !== value)
        {
            model_internal::_supplier_nameIsValid = value;
            this.dispatchEvent(mx.events.PropertyChangeEvent.createUpdateEvent(this, "supplier_nameIsValid", oldValue, value));
        }                             
    }

    [Bindable(event="propertyChange")]
    public function get supplier_nameIsValid():Boolean
    {
        if (!model_internal::_supplier_nameIsValidCacheInitialized)
        {
            model_internal::calculateSupplier_nameIsValid();
        }

        return model_internal::_supplier_nameIsValid;
    }

    model_internal function calculateSupplier_nameIsValid():void
    {
        var valRes:ValidationResultEvent = model_internal::_supplier_nameValidator.validate(model_internal::_instance.supplier_name)
        model_internal::_supplier_nameIsValid_der = (valRes.results == null);
        model_internal::_supplier_nameIsValidCacheInitialized = true;
        if (valRes.results == null)
             model_internal::supplier_nameValidationFailureMessages_der = emptyArray;
        else
        {
            var _valFailures:Array = new Array();
            for (var a:int = 0 ; a<valRes.results.length ; a++)
            {
                _valFailures.push(valRes.results[a].errorMessage);
            }
            model_internal::supplier_nameValidationFailureMessages_der = _valFailures;
        }
    }

    [Bindable(event="propertyChange")]
    public function get supplier_nameValidationFailureMessages():Array
    {
        if (model_internal::_supplier_nameValidationFailureMessages == null)
            model_internal::calculateSupplier_nameIsValid();

        return _supplier_nameValidationFailureMessages;
    }

    model_internal function set supplier_nameValidationFailureMessages_der(value:Array) : void
    {
        var oldValue:Array = model_internal::_supplier_nameValidationFailureMessages;

        var needUpdate : Boolean = false;
        if (oldValue == null)
            needUpdate = true;
    
        // avoid firing the event when old and new value are different empty arrays
        if (!needUpdate && (oldValue !== value && (oldValue.length > 0 || value.length > 0)))
        {
            if (oldValue.length == value.length)
            {
                for (var a:int=0; a < oldValue.length; a++)
                {
                    if (oldValue[a] !== value[a])
                    {
                        needUpdate = true;
                        break;
                    }
                }
            }
            else
            {
                needUpdate = true;
            }
        }

        if (needUpdate)
        {
            model_internal::_supplier_nameValidationFailureMessages = value;   
            this.dispatchEvent(mx.events.PropertyChangeEvent.createUpdateEvent(this, "supplier_nameValidationFailureMessages", oldValue, value));
            // Only execute calculateIsValid if it has been called before, to update the validationFailureMessages for
            // the entire entity.
            if (model_internal::_instance.model_internal::_cacheInitialized_isValid)
            {
                model_internal::_instance.model_internal::isValid_der = model_internal::_instance.model_internal::calculateIsValid();
            }
        }
    }

    [Bindable(event="propertyChange")]   
    public function get supplier_serialnumber_fkStyle():com.adobe.fiber.styles.Style
    {
        return model_internal::_nullStyle;
    }

    [Bindable(event="propertyChange")]   
    public function get pro_serialnumber_fkStyle():com.adobe.fiber.styles.Style
    {
        return model_internal::_nullStyle;
    }

    [Bindable(event="propertyChange")]   
    public function get on_handStyle():com.adobe.fiber.styles.Style
    {
        return model_internal::_nullStyle;
    }


     /**
     * 
     * @inheritDoc 
     */ 
     override public function getStyle(propertyName:String):com.adobe.fiber.styles.IStyle
     {
         switch(propertyName)
         {
            default:
            {
                return null;
            }
         }
     }
     
     /**
     * 
     * @inheritDoc 
     *  
     */  
     override public function getPropertyValidationFailureMessages(propertyName:String):Array
     {
         switch(propertyName)
         {
            case("po_expected_datetime"):
            {
                return po_expected_datetimeValidationFailureMessages;
            }
            case("po_id"):
            {
                return po_idValidationFailureMessages;
            }
            case("po_issue_date"):
            {
                return po_issue_dateValidationFailureMessages;
            }
            case("supplier_name"):
            {
                return supplier_nameValidationFailureMessages;
            }
            default:
            {
                return emptyArray;
            }
         }
     }

}

}
